<%--
  Created by IntelliJ IDEA.
  User: 86158
  Date: 2022/2/26
  Time: 22:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>CoolMeeting会议管理系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/styles/common.css"/>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js"></script>
    <script type="text/javascript">
        <%--        判断输入的密码是否一致--%>
        function check(){
            var newpassword=document.getElementById("newpassword");
            var confirm=document.getElementById("confirm");
            var confirminfo=document.getElementById("confirminfo");
            if(confirm.value!=newpassword.value){
                confirminfo.innerHTML="两次输入不一致";
            }else {
                confirminfo.innerHTML="两次输入一致";
            }
        }
        //判断表单内容是否为空
        function cc(form){
            // var employeename=$(".employeename").val();
            // var username=$(".username").val();
            // var password=$(".password").val();
            // var phone=$(".phone").val();
            // var email=$(".email").val();
            // var departmentid=$(".departmentid").val();
            // alert("employeename:"+employeename+"username:"+username+"password:"+password);
            if(form.oldpassword.value==''||form.newpassword.value==''||form.confirm.value!=form.newpassword.value){
                alert("信息中有空值或两次输入的密码不一致");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<div class="page-header">
    <div class="header-banner">
        <img src="${pageContext.request.contextPath}/images/header.png" alt="CoolMeeting"/>
    </div>
    <div class="header-title">
        欢迎访问Cool-Meeting会议管理系统
    </div>
    <div class="header-quicklink">
        欢迎您，<strong>${sessionScope.currentuser.employeename}</strong>
        <a href="changepassword.html">[修改密码]</a>
    </div>
</div>
<div class="page-body">
    <div class="page-sidebar">
        <div class="sidebar-menugroup">
            <jsp:include page="leftMenu.jsp" flush="true"></jsp:include>
        </div>
    </div>
    <div class="page-content">
        <div class="content-nav">
            修改密码
        </div>
        <form action="${pageContext.request.contextPath}/doNew" method="post">
            <fieldset>
                <legend>修改密码信息</legend>
                <table class="formtable" style="width:50%">
                    <tr>
                        <td>原密码:</td>
                        <td>
                            <input name="oldpassword" id="oldpassword" type="password" />
                            <a style="color: red">${error}</a>
                        </td>
                    </tr>
                    <tr>
                        <td>新密码:</td>
                        <td>
                            <input name="newpassword" id="newpassword" type="password" />
                        </td>
                    </tr>
                    <tr>
                        <td>确认新密码：</td>
                        <td>
                            <input id="confirm" type="password" onblur="check()"/>
                            <div style="color: red;" id="confirminfo"></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="command">
                            <input type="submit" value="确认修改" class="clickbutton" onclick="return cc(this.form)"/>
                            <input type="button" value="返回" class="clickbutton" onclick="window.history.back();"/>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </div>
</div>
<div class="page-footer">
    <hr/>
    更多问题，欢迎联系<a href="mailto:webmaster@eeg.com">管理员</a>
    <img src="${pageContext.request.contextPath}/images/footer.png" alt="CoolMeeting"/>
</div>
</body>
</html>
